package com.tj.test.sys.service.impl;

import com.tj.test.sys.dao.RegisterMapper;
import com.tj.test.sys.po.Register;
import com.tj.test.sys.service.IRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class RegisterService implements IRegisterService {
    @Autowired
    private RegisterMapper mapper;

    @Override
    //根据personid查询登录信息
    public List selectById(int personid) {
        List<Register> list=mapper.selectById(personid);

        return list;
    }

    @Override
    //插入登录信息
    public int insertRegister(Register register) {
        int temp=0;
        try{
                temp=mapper.insertRegister(register);
                if (temp>0){
                    System.out.println("插入成功");
                }

        }catch (Exception e){
            System.out.println("数据库错误");return -1;
        }
        return temp;
    }


}
